package org.linlinjava.litemall.db.dao.order_manage;

import org.apache.ibatis.annotations.Param;
import org.linlinjava.litemall.db.domain.*;
import org.linlinjava.litemall.db.vo.order_manage.*;
import org.linlinjava.litemall.db.vo.service_order.SelectServiceOrderListDto;
import org.linlinjava.litemall.db.vo.service_order.ServiceOrderBackDto;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

/**
 * @author wj
 * @date 2021/5/28 10:32
 */
public interface AgedMallOrderMapper {

    List<OrderListBackVo> selectOrderManageList(@Param("adminPhone") String adminPhone, @Param("storeId") Integer storeId, @Param("phone") String phone, @Param("orderStatus") Integer orderStatus, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime, @Param("isAfterSale") Integer isAfterSale);

    List<OrderGoodsBackVo> selectOrderStoreGoodsByStoreIdAndOrderId(@Param("storeId") Integer storeId, @Param("orderId") Integer orderId);

    List<OrderGoodsBackVo> selectOrderStoreGoodsByOrderId(@Param("orderId") Integer orderId);

    List<LitemallAftersale> selectAfterSaleByOrderIdAndOrderGooodsId(@Param("orderId") Integer orderId, @Param("orderGoodsId") Integer orderGoodsId);

    List<OrderGoodsBackVo> selectAfterSaleGoodsByOrderId(@Param("orderId") Integer orderId);

    List<LitemallAftersale> selectAfterSaleByOrderId(@Param("orderId") Integer orderId);

    LitemallSystem selectSystemConfigByKeyName(@Param("name") String name);

    List<LitemallRegion> getCityList(@Param("id") Integer id, @Param("type") Integer type);

    List<AgedmallStore> selectStoreListByCityId(@Param("provinceId") Integer provinceId, @Param("cityId") Integer cityId);

    int insertPackageBatch(@Param("list") List<AgedmallLogisticsPackageInfo> list);

    int updateOrderByOrderSn(@Param("status") Integer status, @Param("shipTime") LocalDateTime shipTime, @Param("orderSn") String orderSn, @Param("code") String code);

    int updateLeaseGoodsReturnByOrderId(@Param("receiveTime") LocalDateTime receiveTime, @Param("endTime") LocalDateTime endTime, @Param("orderId") Integer orderId, @Param("subOrderIds") Integer subOrderIds);

    int updateLeaseGoodsReturnRefundByOrderId(GoodsReturnRefundDto goodsReturnRefundDto);

    int updatedeductDetailBySubOrderSn(DeductDetailVo deductDetailVo);

    int updateAgedmallUserInfoBySubOrderSn(AgedmallUserInfoVo agedmallUserInfoVo);

    /**
     * 获取运维订单数量
     *
     * @param params
     * @return
     */
    int getAdminOrderCount(Map<String, Object> params);

    /**
     * 获取运维订单列表
     *
     * @param params
     * @return
     */
    List<AgedAdminOrderItemInfoVo> getAdminOrderList(StoreOrderAdminQuery storeOrderAdminQuery);

    /**
     * 获取订单内的物品rfid列表
     *
     * @param params orderId 大订单id号
     * @return
     */
    List<String> getOrderEquRfidList(Map<String, Object> params);

    /**
     * 更新rfid对应的订单号
     *
     * @param orderCode
     * @param rfids
     * @return
     */
    int updateRfidCurOrderCode(@Param("orderCode") String orderCode, @Param("rfids") List<String> rfids, @Param("type") Integer type);

    /**
     * 获取用户租赁订单申请归还的订单号信息
     * @param params
     * @return
     */
    OrderCodeInfo getUserLeaseApplyBackOrderInfo(Map<String,Object> params);

    List<OrderDetailMissionVo> selectOrderDetailMissionMessage(@Param("list")List<Integer> list);
}
